package com.bitin.module.misc.domain.entity;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "region")
public class Region implements Serializable {
    @Id
    private String code;
    private String name;
    private String citycode;
    private String center;
    @Enumerated(value = EnumType.STRING)
    private Level level;
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(name = "pcode", referencedColumnName = "code")
    private List<Region> regions;
}
